// wx.request()二次封装
const app =getApp()
module.exports = (url,data,method='get',header={})=>{
  // 加载数据 loding
  wx.showLoading({
    title: '数据加载中...',
    mask:true
  })
  return new Promise((resolve,reject)=>{
    wx.request({
      url: app.config.apiBase+url,
      data,
      header,
      method,
      dataType:'json',
      success:resolve,
      fail:reject,
      complete:wx.hideLoading

    })
  })
}